<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>司机车辆管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
		});

        function auditView(id){
            $("#tr_"+id).show();
            $("#auditView_"+id).hide();

        }
        function auditCancel(id){
            $("#tr_"+id).hide();
            $("#auditView_"+id).show();
        }
        function auditConfirm(id){
            var licensePlate = $("#licensePlate_"+id).val();
            var models = $("#models_"+id).val();
            var owner = $("#owner_"+id).val();
            var address = $("#address_"+id).val();
            var vin = $("#vin_"+id).val();
            var registDate = $("#registDate_"+id).val();
            var issuingDate = $("#issuingDate_"+id).val();
            var masterDriver = $("#masterDriver_"+id).val();
            $.ajax({
                type:'POST',
                url:'${ctx}/logis/logisCar/confirm',
                data:{id:id,licensePlate:licensePlate,models:models,owner:owner,address:address,vin:vin,registDate:registDate,
					issuingDate:issuingDate,masterDriver:masterDriver},
                dataType:'json',
                timeout:10000,
                success:function(data){
                    if(data.success){
                        layer.alert('操作成功!', {icon: 6}, function (index) {
                            layer.close(index);
                            window.location.href = '${ctx}/logis/logisCar/';
                        });
                    }else{
                        layer.alert(data.msg, {icon: 6});
                    }
                },
                error:function(e){
                    layer.alert('服务器忙,登录失败', {icon: 6});
                }
            });
		}

		function auditRefuse(id){
            layer.prompt({title: '拒绝原因', formType: 2}, function(text, index){
                layer.close(index);
                window.location.href="${ctx}/logis/logisCar/auditRefuse?id="+id+"&carRefusalReason="+text;
            });
            //
		}

        //打开对话框(查看)
        function openDialogViewImg(title,url,width,height){
            top.layer.open({
                type: 1,
                title: false,
                offset: ['20px', '20px'],
                shadeClose: true,
                area: ['420px', '360px'], //宽高
                content: '<img src='+url+' width=420px,height=360px>'
            });


        }

	</script>
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content">
	<div class="ibox">
	<div class="ibox-title">
		<h5>车辆认证 </h5>
	</div>
    <div class="ibox-content">
	<sys:message content="${message}"/>
	
	<!--查询条件-->
	<div class="row">
	<div class="col-sm-12">
	<form:form id="searchForm" modelAttribute="logisCar" action="${ctx}/logis/logisCar/" method="post" class="form-inline">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
		<div class="form-group">
			<span>车牌：</span>
				<form:input path="licensePlate" htmlEscape="false" maxlength="32"  class=" form-control input-sm"/>
			<div class="pull-right">
				<button  class="btn btn-primary btn-sm " onclick="search()" ><i class="fa fa-search"></i> 查询</button>
			</div>
		 </div>	
	</form:form>
	<br/>
	</div>
	</div>
	

	
	<!-- 表格 -->
	<table id="contentTable" class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
		<thead>
			<tr>
				<th>司机姓名</th>
				<th>手机号</th>
				<th>身份证号</th>
				<th>是否主驾驶</th>
				<th>司机认证状态</th>

				<th>车牌号</th>
                <th>车型信息</th>
				<th>行驶证正本</th>
				<th>行驶证副本</th>
                <th>车辆认证状态</th>

				<th width="5%">操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="logisCar">
			<tr>
				<td>${logisCar.realName}</td>
				<td>
						${logisCar.mobile}
				</td>
				<td>
						${logisCar.idCardNum}
				</td>
				<td>
					<c:if test="${logisCar.driverType eq '1'}">
						主驾驶
					</c:if>
					<c:if test="${logisCar.driverType ne '1'}">
						副驾驶
					</c:if>

				</td>
				<td>
						${fns:getDictLabel(logisCar.driverStatus, 'logis_car_status', '')}
				</td>

				<td>
					${logisCar.licensePlate}
				</td>
                <td>
                        ${logisCar.models}
                </td>
				<td>
					<c:if test="${not empty logisCar.xszImg1}">
						<a  onclick="openDialogViewImg('查看图片', '${logisCar.xszImg1}','800px', '500px')">查看</a>
					</c:if>
					<c:if test="${empty logisCar.xszImg1}">
						未上传
					</c:if>
				</td>
				<td>
					<c:if test="${not empty logisCar.xszImg2}">
						<a  onclick="openDialogViewImg('查看图片', '${logisCar.xszImg1}','800px', '500px')">查看</a>
					</c:if>
					<c:if test="${empty logisCar.xszImg2}">
						未上传
					</c:if>
				</td>
				<td>
						${fns:getDictLabel(logisCar.carStatus, 'logis_car_status', '')}
				</td>
				<td>
					<a href="#" onclick="openDialog('查看', '${ctx}/logis/logisCar/form?id=${logisCar.id}','880px', '600px')" class="btn btn-info btn-xs" >查看</a>
				</td>
			</tr>




		</c:forEach>
		</tbody>
	</table>

		<!-- 分页代码 -->
	<table:page page="${page}"></table:page>
	<br/>
	<br/>
	</div>
	</div>
</div>
</body>

</html>